cmake_minimum_required(VERSION 3.10)

project(shadesmar)

set(sdk_path /home/xiangang/code/sdk_rv1126/rv1126_clean_source_2020.10.10_0848)
# set(sdk_path /home/xiangang/software/rv1126_clean_source_2020.10.10_0848)
# set(sdk_path /tools/rv1126_rv1109_linux_sdk_v1.8.0_20210224)
# set(toolchain ${sdk_path}/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf)
# set(CMAKE_C_COMPILER ${toolchain}/bin/arm-linux-gnueabihf-gcc)
# set(CMAKE_CXX_COMPILER ${toolchain}/bin/arm-linux-gnueabihf-g++)
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")


# set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
# set(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG_BUILD")

#find_package(benchmark REQUIRED)

set(CMAKE_CXX_STANDARD 17)

include_directories(include)

# if (UNIX AND NOT APPLE)
  list(APPEND libs rt pthread stdc++fs)
# endif ()

# add_compile_options(-march=native)
# IF(SINGLE_H)
  # add_definitions(-DSINGLE_HEADER)
# ENDIF(SINGLE_H)


#add_executable(flush_tmp src/flush_tmp.cpp)
#target_link_libraries(flush_tmp ${libs})

# TESTS

# add_executable(pubsub_test test/pubsub_test.cpp)
# target_link_libraries(pubsub_test ${libs})

# add_executable(pubsub_s test/pubsub_s.cpp)
# target_link_libraries(pubsub_s ${libs})

# add_executable(pubsub_c test/pubsub_c.cpp)
# target_link_libraries(pubsub_c ${libs})

add_executable(server test/server.cpp)
target_link_libraries(server ${libs})

add_executable(client test/client.cpp)
target_link_libraries(client ${libs})

# add_executable(shm_test_a test/shm_test_a.cpp)
# target_link_libraries(shm_test_a ${libs})

# add_executable(shm_test_b test/shm_test_b.cpp)
# target_link_libraries(shm_test_b ${libs})

#add_executable(dragons_test test/dragons_test.cpp)
#target_link_libraries(dragons_test ${libs})

#add_executable(allocator_test test/allocator_test.cpp)
#target_link_libraries(allocator_test ${libs})

# BENCHMARKS
#add_executable(dragons_bench benchmark/dragons.cpp)
#target_link_libraries(dragons_bench ${libs} benchmark::benchmark)

#add_executable(pubsub_bench benchmark/pubsub.cpp)
#target_link_libraries(pubsub_bench ${libs})

